<template>
  <div class="member-home">
     <!-- 概览 -->
    <HomeVverview />
    <!-- 收藏 -->
    <HomePanel title="我的收藏">
        <GoodsItem v-for="item in collectGoods" :key="item.id" :goods="item" />
    </HomePanel>
    <!-- 足迹 -->
    <HomePanel title="我的足迹">
        <GoodsItem v-for="item in collectGoods" :key="item.id" :goods="item" />
    </HomePanel>
    <!-- 猜你 -->
    <GoodsRelevant />
  </div>
</template>

<script>
import HomeVverview from './components/HomeVverview.vue'
import HomePanel from './components/HomePanel.vue'
import GoodsRelevant from '@/views/goods/components/GoodsRelevant.vue'
import GoodsItem from '@/views/category/components/GoodsItem.vue'
import {findCollect} from '@/api/member'
import {ref} from 'vue'
export default {
name:'MemberHome',
components:{HomeVverview,HomePanel,GoodsRelevant,GoodsItem},
setup(){
    // 调用模拟的接口
    const collectGoods = ref([])
    findCollect({
      page: 1,
      pageSize: 4
    }).then(data => {
        console.log('data',data);
      collectGoods.value = data.result.items
    })

    return {collectGoods}
}
}
</script>

<style lang='less' scoped>
:deep(.xtx-carousel) .carousel-btn.prev {
  left: 5px;
}
:deep(.xtx-carousel) .carousel-btn.next {
  right: 5px;
}
</style>